package com.wsf.homework_20191223.myrun;

import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
@EnableScheduling
public class MyThread {

    @Scheduled(fixedDelayString = "2000")
    public void run1() throws JSONException {
        JSONObject object=new JSONObject();
        object.put("姓名","小王");
        object.put("年龄",15);
        object.put("单身情况",true);
        System.out.println(object.toJSONString());
    }

}
